package com.whatech.mall.user.config;

import com.whatech.mall.user.interceptor.MsJwtValidateInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 用户服务配置。
 */
@Configuration
public class UserServiceConfiguration extends WebMvcConfigurationSupport {

    @Autowired
    private MsJwtValidateInterceptor msJwtValidateInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(msJwtValidateInterceptor).addPathPatterns("/user/**");
    }

}
